Repository navigation
Refactor runtime decisions into a functional core and fix wake/timeout edge cases - #109
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows the repository-wide functional-programming review of master at 42b842a (v0.1.61).
The review found two concrete failure modes: AsyncEvent sends notifications while holding its mutex, so a synchronous waker that registers another listener deadlocks; finite but oversized TLS timeouts reach a panicking Duration conversion. Both were reproduced with failing regression tests before the fixes.
Changes:
Review scope:
Validation on Linux x86_64, CPython 3.14.7, Rust nightly-2026-09-25:
Performance:
Identical uninstrumented release builds against 42b842a, pinned to CPU 0, ABBA order. The new functional_core example used 100,000 rounds × 7 samples per run (14 samples/build); the existing stream_read_lifecycle benchmark used 20,000 rounds × 5 samples per run (10 samples/build). Medians, nanoseconds/round:
These are local microbenchmarks, not a production speedup claim. Notification snapshots require a second lock acquisition on nonempty broadcasts to recycle capacity; reentrant registrations may allocate separately. The measured stream differences range from -1.6% to +3.0%.
Reproduce the added benchmark: